package me.yuzho.study.concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;

public class FixedThreadPool {

    public static void main(String[] args) {
        
      //Use fixed thread pool to run tasks
      final ExecutorService  exec = Executors.newFixedThreadPool(5);
      
      IntStream.range(0, 6).forEach(i -> {
          exec.execute(new ListOff());
      });
      
      exec.shutdown();
    }

}
